/*
 * @Author: your name
 * @Date: 2021-08-09 19:59:32
 * @LastEditTime: 2021-08-10 18:46:17
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \code-learn\src\modules\user\user.service.ts
 */
import { Injectable } from '@nestjs/common';
import { InjectModel } from '@nestjs/mongoose';
import { Model } from 'mongoose';
import { IResponse } from 'src/interfaces/response.interface';
import { User } from 'src/interfaces/user.interface';

@Injectable()
export class UserService {
  private response: IResponse;
  constructor(
    @InjectModel('USER_MODEL') private readonly userModel: Model<User>,
  ) {}

  public async findOneByPhone(phone: string) {
    return await this.userModel.find({
      phone,
    });
  }
}
